package com.sinoglobal.ningxia.activity.mico;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import com.sinoglobal.networkconnections.ResultCallback;
import com.sinoglobal.ningxia.R;
import com.sinoglobal.ningxia.beans.programInfoVo;
import com.sinoglobal.ningxia.downdata.imp.RemoteImpl;
import com.sinoglobal.ningxia.utils.ItktLog;

/**
 * @author qiwx
 * @createdate 2014-4-29 15:50:42
 * @Description:视频播放
 */
public class VideoHActivity extends BaseHVideoPlayActivity {
    String url1 = "http://video.sinosns.cn/fmmgc/shuishangfeixing8.mp4";
    programInfoVo infoVo;//

    @SuppressLint("NewApi")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.h_video);
        Intent get = getIntent();
        infoVo = (programInfoVo) get.getSerializableExtra(programInfoVo.class.getName());
        if (infoVo == null)
            return;
        url = infoVo.getVideo_url();
        String id = infoVo.getId();
        if (id != null && !id.equals("")) {
            RemoteImpl.getInstance().getNewslookNum(this, id, 2).execute(new ResultCallback(this));
        }
        ItktLog.i(url);
        String title = infoVo.getName();
        ((TextView) findViewById(R.id.title_text)).setText(title);
        Log.e("media", "onCreate");
        findVideoId(false, false);
        initSurfaceView();
    }

}
